package com.czh.rdm.chat_2

class Counter {
    var i = 0
        get() {
            println("get i $field")
            return field
        }
//        private set(value) {
//            println("set i $field")
//            field = value
//        }
}

fun main() {
    val counter = Counter()
    println(counter.i)
    counter.i = 10
    println(counter.i)

    val s: String? = "a"
    println(s?.length)
    println(s?.length ?: 0)
    println(s!!.length)
}